package study.springcloud.client.feign.support;

import lombok.extern.slf4j.Slf4j;
import org.apache.http.impl.client.CloseableHttpClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.ribbon.SpringClientFactory;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.cloud.openfeign.ribbon.LoadBalancerFeignClient;

import javax.annotation.PostConstruct;

@Slf4j
@EnableDiscoveryClient
@SpringBootApplication(scanBasePackages = "study.springcloud.client.feign")
public class SpringBootCfg {

    @Autowired
    private SpringClientFactory client;

    @Autowired(required = false)
    private CloseableHttpClient mClient;

    @PostConstruct
    public void init() {
        log.info("========= {}", client);
        log.info("========= {}", mClient);
    }
}
